<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Cron extends CI_Controller {

    public $css = null;
    public $js = null;

    public function __construct() {
        parent::__construct();
        $this->css = array('bootstrap', 'menu', 'small-business', 'painel_user', 'tabs', 'hover', '../lighter/css/lighter');
        $this->js = array('jquery-1.10.2', 'bootstrap', 'funcoesComuns', 'jquery.maskedinput.min', 'jquery.dataTables.min', 'jquery.form.min');
        //$this->load->helper();
        $this->load->model('home_model', 'home');
        //$this->load->dbforge();
    }

    public function deleteAdminInativo() {
        $this->db->select('*');
        $this->db->from("tcc_administrador");
        $this->db->where("STATUS",'0');
        $this->db->where('DATEDIFF(NOW(),DATA_CADASTRO) >','7');
        $sql = $this->db->get();
        echo $sql->num_rows;
        echo "<br>";
        echo $this->db->last_query();
    }
    public function deleteAtendenteInativo() {
        $this->db->select('PES.*');
        $this->db->from("tcc_pessoa AS PES");
        $this->db->join('tcc_atendente as ATE', 'ATE.CODIGO_PESSOA = PES.CODIGO');
        $this->db->where("ATE.STATUS",'0');
        $this->db->where('DATEDIFF(NOW(),PES.DATA_CADASTRO) >','7');
        $sql = $this->db->get();
        echo $sql->num_rows;
        echo "<br>";
        echo $this->db->last_query();
    }

}

/* End of file home.php */
/* Location: ./application/controllers/cron.php */